L.GridLayer.DebugCoords = L.GridLayer.extend({
    createTile(coords, done) {
        const tile = document.createElement('div');
        tile.innerHTML = [coords.x, coords.y, coords.z].join(', ');
        tile.style.outline = '1px solid red';

        setTimeout(() => {
            // done(error, tile)
            done(null, tile);
        }, Math.random() * 1500 + 500);
        return tile;
    },
});

L.gridLayer.debugCoords = function (opts) {
    return new L.GridLayer.DebugCoords(opts);
};
